<?php

namespace app\modules\admin\controllers;

use app\common\controllers\AccessController;
use app\modules\admin\services\UserService;

class UserController extends AccessController{

    public function actionSearch(){
        $username = \Yii::$app->getRequest()->get("username");
        $mobile = \Yii::$app->getRequest()->get("mobile");
        $type = \Yii::$app->getRequest()->get("type");
        $status = \Yii::$app->getRequest()->get("status");
        $pagesize = \Yii::$app->getRequest()->get("pagesize");

        return [
            'list'=>UserService::search($username,$mobile,$type,$status,$page,$pagesize),
            'page'=>$page->Out(),
        ];
    }

    //更新状态
    public function actionUpdateStatus($id,$status)
    {
        UserService::updateStatusById($id,$status);
        return "";
    }
}